#include <eigen3/Eigen/Dense>
#include <iostream>

int main(){
    // Create a 4x4 matrix
    Eigen::MatrixXd mat(4,4);
    mat << 1, 2, 3, 0,
           4, 5, 6, 7,
           0, 1, 9, 8,
           1, 0, 9, 11;
    std::cout << "Original matrix:\n" << mat << std::endl;
    
    // Create a 2x2 replacement matrix
    Eigen::MatrixXd block(2,2);
    block << 0, 1,
             1, 0;
    
    // Replace with a block operation
    mat.block<2, 2>(2, 0) = block;
    std::cout << "Modified matrix:\n" << mat << std::endl;
    return 0;
}

